package com.kefu.call.vo;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.call.model.CallInnumber;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractSearchVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;

/**
 * @author CodeGenerator
 * @date 2022/07/24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "呼入号码")
public class CallInnumberSearchVo extends AbstractSearchVo {

    @ApiModelProperty(value = "呼入号码")
    private String callnumber;
    @ApiModelProperty(value = "说明")
    private String remarks;

    @Override
    public LambdaQueryWrapper<CallInnumber> lambdaQuery() {
        LambdaQueryWrapper<CallInnumber> wrapper = Wrappers.<CallInnumber>lambdaQuery();
        wrapper.eq(StringUtils.isNotBlank(callnumber), CallInnumber::getCallnumber, callnumber);//呼入号码
        wrapper.like(StringUtils.isNotBlank(remarks), CallInnumber::getRemarks, remarks);//说明
        wrapper.eq(CallInnumber::getCompany, KefuContext.getTid());//公司id
        return wrapper;
    }
}